package cn.sc.allinpay.allfavour.business.common.data;

import android.os.Parcel;
import android.os.Parcelable;

import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;

/**
 * 该交易对象只用于存储在数据库
 * description：验券交易记录
 * author：pany
 * on 2018/8/16 15:02
 */
public class CheckCouponsRecord implements Parcelable {

    @DatabaseField(generatedId = true)
    public int id;

    @DatabaseField(columnName = "TRANSNO", unique = true)
    public String transNo;//流水号

    @DatabaseField(columnName = "ORDERID")
    public String orderId;//订单号

    @DatabaseField(columnName = "COUPONNO")
    private String couponNo;//券号

    @DatabaseField(columnName = "COUPONCODE")
    private String couponCode;//券号

    @DatabaseField(columnName = "COUPONNAME")
    private String couponName;//券名称

    @DatabaseField(columnName = "BALANCE")
    private String balance;//余额    单位: 分

    @DatabaseField(columnName = "UNIT")
    private String unit;//单位

    @DatabaseField(columnName = "TYPE")
    private int type;//类型    0金额 1抵扣 2计次

    @DatabaseField(columnName = "DESC")
    private String desc;//使用说明

    @DatabaseField(columnName = "OPERATOR")
    private String operator;//操作员

    @DatabaseField(columnName = "OPERATORNAME")
    private String operatorName;//操作员名称

    @DatabaseField(columnName = "TRANSDATE")
    private String transDate;//交易日期

    @DatabaseField(columnName = "TRANSTIME")
    private String transTime;//交易日期

    @DatabaseField(columnName = "USENUM")
    private int useNum = 0;//使用 type=1或2的张数

    @DatabaseField(columnName = "USEAMT")
    private String useAmt;//使用金额，type=0的使用金额

    public CheckCouponsRecord() {

    }

    protected CheckCouponsRecord(Parcel in) {
        id = in.readInt();
        transNo = in.readString();
        orderId = in.readString();
        couponNo = in.readString();
        couponCode = in.readString();
        couponName = in.readString();
        balance = in.readString();
        unit = in.readString();
        type = in.readInt();
        desc = in.readString();
        operator = in.readString();
        operatorName = in.readString();
        transDate = in.readString();
        transTime = in.readString();
        useNum = in.readInt();
        useAmt = in.readString();
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTransNo() {
        return transNo;
    }

    public void setTransNo(String transNo) {
        this.transNo = transNo;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getCouponNo() {
        return couponNo;
    }

    public void setCouponNo(String couponNo) {
        this.couponNo = couponNo;
    }

    public String getCouponCode() {
        return couponCode;
    }

    public void setCouponCode(String couponCode) {
        this.couponCode = couponCode;
    }

    public String getCouponName() {
        return couponName;
    }

    public void setCouponName(String couponName) {
        this.couponName = couponName;
    }

    public String getBalance() {
        return balance;
    }

    public void setBalance(String balance) {
        this.balance = balance;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getOperator() {
        return operator;
    }

    public void setOperator(String operator) {
        this.operator = operator;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public String getTransDate() {
        return transDate;
    }

    public void setTransDate(String transDate) {
        this.transDate = transDate;
    }

    public String getTransTime() {
        return transTime;
    }

    public void setTransTime(String transTime) {
        this.transTime = transTime;
    }

    public int getUseNum() {
        return useNum;
    }

    public void setUseNum(int useNum) {
        this.useNum = useNum;
    }

    public String getUseAmt() {
        return useAmt;
    }

    public void setUseAmt(String useAmt) {
        this.useAmt = useAmt;
    }

    public static final Creator<CheckCouponsRecord> CREATOR = new Creator<CheckCouponsRecord>() {
        @Override
        public CheckCouponsRecord createFromParcel(Parcel in) {
            return new CheckCouponsRecord(in);
        }

        @Override
        public CheckCouponsRecord[] newArray(int size) {
            return new CheckCouponsRecord[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeInt(id);
        parcel.writeString(transNo);
        parcel.writeString(orderId);
        parcel.writeString(couponNo);
        parcel.writeString(couponCode);
        parcel.writeString(couponName);
        parcel.writeString(balance);
        parcel.writeString(unit);
        parcel.writeInt(type);
        parcel.writeString(desc);
        parcel.writeString(operator);
        parcel.writeString(operatorName);
        parcel.writeString(transDate);
        parcel.writeString(transTime);
        parcel.writeInt(useNum);
        parcel.writeString(useAmt);
    }
}
